<?php

class Application_Model_DbTable_Gallery extends Zend_Db_Table_Abstract
{

    protected $_name = 'txy_gallery';
    
    public function addNewGallery($data){
    	$this->insert($data);
    }

    public function getGalleryById($id){
    	$res=$this->fetchRow('gallery_id='.$id);
    	if(!$res){
    		throw new Exception("没有对应的图集");
    	}
    	return $res;
    }
    
    public function updateCount($id,$count){
    	$data=array('gallery_count_num'=>$count);
    	$this->update($data, 'gallery_id='.$id);
    }
    

}

